package com.kingmed.kmss.common.exception;


import com.kingmed.kmss.common.enums.base.code.IResultCode;

/**
 * 自定义业务异常(仅用于内部发生的业务异常)
 */
public class BusinessException extends RuntimeException {
    /**
	 * 
	 */
	private static final long serialVersionUID = -4830173219306183990L;
	private IResultCode resultCode;


    public BusinessException(IResultCode resultCode) {
        super(resultCode.getMessage());
        this.resultCode = resultCode;
    }

    public BusinessException(String message) {
        super(message);
    }

    public BusinessException(String format, Object... args) {
        super(String.format(format, args));
    }

    public BusinessException(Throwable cause) {
        super(cause);
    }

    public BusinessException(String message, Throwable cause) {
        super(message, cause);
    }

    public IResultCode getErrorCode() {
        return resultCode;
    }
}
